<script>
	import {
		wxAuthApi
	} from "@/api/apis/comm.js"
	export default {
		onLaunch: function(options) {
			console.log(options, '---')
			console.log('App Launch');
			// 分销用uid  推广用did
			let puid = 0
			let sid = 0
			let did = 0
			let share_type = 0
			if (options.query.q) {
				let info = decodeURIComponent(options.query.q);
				let arr = info.split('uid=')
				if (arr.length == 2) {
					puid = arr[1];
				}
				let arr1 = info.split('sid=')
				if (arr1.length == 2) {
					sid = arr1[1];
				}
				let arr2 = info.split('did=')
				if (arr2.length == 2) {
					did = arr2[1];
				}
				let arr3 = info.split('share_type=')
				if (arr3.length == 2) {
					share_type = arr3[1];
				}

			} else {
				puid = options.query && options.query.uid ? options.query.uid : 0;
				did = options.query && options.query.did ? options.query.did : 0;
				sid = options.query && options.query.sid ? options.query.sid : 0;
				share_type = options.query && options.query.share_type ? options.query.share_type : 0;
			}
			this.$store.dispatch('login', {
				puid,
				did,
				share_type,
				sid,
			});
		},
		onShow: function(options) {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";

	page {
		background-color: #F5F5F5;
	}

	button::after {
		border: none;
	}

	button {
		margin: 0;
		padding: 0;
		outline: none;
		border-radius: 0;
		background-color: transparent;
		line-height: inherit;
	}

	button:hover {
		background: none;
	}

	.lb-main {
		padding: 26rpx;
	}

	.lb-main-32 {
		padding: 32rpx;
		box-sizing: border-box;
	}

	.lb-main-box {
		background: rgba(255, 255, 255, 1);
		box-shadow: 0rpx 2rpx 4rpx rgba(0, 0, 0, 0.16);
		border-radius: 16rpx;
		padding: 24rpx 32rpx;
		box-sizing: border-box;
		margin-bottom: 30rpx;

	}

	image {
		display: block;
		width: 100%;
		height: 100%;
	}
</style>